<template>
  <div class="detail">
    <div class="news-bg">
      <img src="" alt="" />
    </div>
    <div class="news-container flex-center flex-direction-column">
      <div class="news-title">
        <div class="title">{{ info.title }}</div>
        <p>发布时间：{{ info.addTime }}</p>
      </div>
      <div v-html="info.content" class="detail-content"></div>
    </div>
  </div>
</template>
<script lang="ts" setup>
import { $http } from '@/service/request/index'

const route = useRoute()
const info = ref<any>({})

const getInfoContent = async (id) => {
  const { data } = (await $http('queryNewsDetail', { id })) as any
  console.log(data)
  info.value = data
}

const newsId = route.query.id
if (newsId) {
  getInfoContent(newsId)
}
onMounted(() => {
  console.log(route.query)
})
</script>
<style lang="scss" scoped>
@import './styles/common.scss';
@import './styles/web.scss';
@import './styles/phone.scss';
</style>
